import React, { PureComponent } from "react"
import Far from "./components/Far"

export default class App extends PureComponent {
  state = {
    count: 0,
  }

  getRandomIntInclusive(min, max) {
    min = Math.ceil(min)
    max = Math.floor(max)
    return Math.floor(Math.random() * (max - min + 1)) + min //含最大值，含最小值
  }

  render() {
    console.log("App更新了")
    return (
      <>
        <Far></Far>
        <button
          onClick={() => {
            this.setState({ count: this.getRandomIntInclusive(1, 2) })
          }}
        >
          按钮
        </button>
      </>
    )
  }
}
